<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const obj = {
      name: '苏州大学',
      age: 180,
      message: '养天地正气,法古今完人',
      address: '苏州'
    }
    // 可以一次性从对象中取出自己需要的属性
    const {name,age,address} = obj
    console.log(name)
    console.log(age)
    console.log(address)

    // 数组的解构(用的较少)
    const names = ['why','kobe','james']
    const [name1,name2] = names
    console.log(name1)
    console.log(name2)
  </script>
</body>
</html>